package com.enki.cigarettes.controller;

import com.enki.cigarettes.entity.RechargeRuleT;
import com.enki.cigarettes.handler.Response;
import com.enki.cigarettes.repository.RechargeRuleTRepository;
import com.enki.cigarettes.statics.StaticKeys;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Sort;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author WCS.Wang
 * @version V1.0
 * @Package com.enki.cigarettes.controller
 * @Name e-cigarettes-shop-api-module
 * @Description: TODO 充值规则
 * @date 2019-08-12
 */
@RestController
@RequestMapping("/api/recharges")
@Slf4j
public class RechargeRulesController {

    @Autowired
    RechargeRuleTRepository rechargeRulesTRepoitory;

//    @ApiOperation(value = "规则列表")
//    @GetMapping
//    public Object findItems() {
//        try {
//            Sort sort = new Sort(Sort.Direction.ASC, "rechargeAmount");
//            List<RechargeRuleT> beanItems = rechargeRulesTRepoitory.findAll(false, sort);
//            return Response.success(beanItems, StaticKeys.SUCCESS);
//        } catch (Exception e) {
//            log.error("获取充值规则失败：" + e.getMessage());
//            e.printStackTrace();
//            return Response.serverError_500("获取充值规则失败");
//        }
//
//    }
}
